﻿#region Using directives

using System;
using System.Collections.Generic;
using System.Text;

using Weazel.Toad.Application.Controls;

#endregion

namespace Weazel.Toad.Application.Actions
{
  public class ShowErrorListAction : ActionBase
  {    
    public ShowErrorListAction()
    {      
      Application.Instance.MainForm.LayoutControl.ContainerPanel.CurrentPageChanged += 
        new EventHandler<EventArgs>(ContainerPanel_CurrentPageChanged);
    }

    public override void Execute(object sender, EventArgs e)
    {
      Application.Instance.MainForm.LayoutControl.ContainerPanel.SetCurrentPage("ErrorList"); 
    }

    void ContainerPanel_CurrentPageChanged(object sender, EventArgs e)
    {
      Checked =
        Application.Instance.MainForm.LayoutControl.ContainerPanel.GetCurrentPage() == "ErrorList" ? 
        true : false;
    }
  }
}
